<template>
  <template v-if="textarea">
    <a-textarea v-bind="$attrs" v-on="$attrs" :placeholder="placeholder" allow-clear max-length="200" show-word-limit auto-size />
  </template>
  <a-input v-bind="$attrs" v-on="$attrs" :placeholder="placeholder" allow-clear v-else>
    <template #suffix v-if="icon">
      <component :is="`icon-${icon}`" />
    </template>
  </a-input>
</template>

<script setup>
  defineProps({
    placeholder: {
      type: String,
      default: '请输入',
    },
    icon: String,
    textarea: Boolean,
  })
</script>
